/*
 *  
 */
package snip;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Scanner;
import javafx.event.ActionEvent;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.ComboBox;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

/**
 * This Class handles Generating source files for new items to be added
 * in a Netbeans Learning Palette.
 * 
 * @author ian
 */
public class TranslateTemplatetoSnippet {
        
    private String SnipXMLFile          = "/snip/res/SnipXMLTemplate.txt";
    private String SnipPopupClassFile   = "/snip/res/SnipPopupClassTemplate.txt";
    private String SnipPopupFormFile    = "/snip/res/SnipPopupFormTemplate.txt";
    private String SnipBundleFile       = "/snip/res/SnipBundleTemplate.txt";
    private String SnipClassFile        = "/snip/res/SnipClassTemplate.txt";
    
    private String BundleFile           = "bundle.properties";
    private String LayerFile            = "layer.xml";
    
    private String frontToBack;
    private String Token_PN_Slash      = "<PackageNameFrontSlash>";
    private String Token_PN_Dot        = "<PackageNameDot>";
    private String Token_Class_Name    = "<ClassName>";
    private String Token_Display_Name  = "<DisplayName>";
    private String Token_Icon_16       = "<Icon16>";
    private String Token_Icon_32       = "<Icon32>";
    private String Token_Palette_Util  = "<PaletteUtilitiesName>";
    private String Token_Tool_Tip      = "<Tooltip>";
    
    private String selected_Category   = "";
    private ArrayList categories_Array = new ArrayList();
    private Boolean Auto               = false;
    
    PopupController Pc;

      /**
       * This constructor for TranslateTemplatetoSnippet handles
       * taking the user defined arguments and turning them into
       * working .java and .xml files for use in a Netbeans Palette.
       * 
       * @param displayNAME
       *        displayName is the name the user sees on the palette itself.
       * @param packageNAME
       *        This is one of the already define code palettes package name.
       * @param classNAME
       *        This is the name to give to the Class being generated.
       * @param icon16NAME
       *        This is the name of a .png icon, size 16x16
       * @param icon32NAME
       *        This is the name of a .png icon, size 32x32
       * @param selectedDIR
       *        This is the directory used to source the generated source files.
       * @param codeNAME
       *        This is the code snippet that the palette uses on drag and drop
       * @param toolNAME
       *        This is the tooltip that the user sees when mouseover a palette item.
       * @param auto 
       *        This option decides if the generated sources are auto installed in
       *        a NetBeans package or a user specified DIR. Default is user specified.
       * 
       * @param pc 
       * @throws FileNotFoundException
       * @throws IOException
       * @throws URISyntaxException  
       */
      public TranslateTemplatetoSnippet
              
              ( 
              String displayNAME, String packageNAME, String  classNAME, 
              String icon16NAME , String icon32NAME , String  selectedDIR,
              String codeNAME   , String toolNAME   , Boolean auto,
              PopupController pc   
              ) throws FileNotFoundException, 
                                 IOException, 
                          URISyntaxException, 
                ParserConfigurationException, 
                                SAXException, 
           TransformerConfigurationException, 
                        TransformerException {
               
               //Check the installation type, user specified or auto.
               Auto = auto;
               
               //Create two types of package names from packageNAME...
               String packageDot = packageNAME;
               String packageSlash = packageNAME.replace(".", "/");
               
               
               //Create the Palette Utilities String
               String[] splitUtilities = packageSlash.split("/");
               StringBuilder strUtil = new StringBuilder();
               strUtil.append(splitUtilities[(splitUtilities.length)-1]);
               strUtil.append("Utilities");
               
               String pu = strUtil.toString();
               
               StringBuilder fb = new StringBuilder();
               for (String elements : splitUtilities){
                    fb.append(elements).append("\\");
               }
               frontToBack = fb.toString();
               
               //Get access to the GUI
               Pc = pc;
               System.out.println("Attributes: " + packageSlash + " " + classNAME + " "
                                                 + icon16NAME + " " + icon32NAME + selectedDIR + " "
                                                 + packageDot );
               
                        //Call snipXML to generate XML file for snippet.
                        snipXML(packageSlash, classNAME, icon16NAME, icon32NAME, selectedDIR, packageDot);
                        //Call snipClass to generate .java class for snippet.
                        snipClass(classNAME, selectedDIR, packageNAME, pu);
                        //Call snipBundle and Layer Entries generator
                        snipBundle(classNAME, displayNAME, toolNAME, selectedDIR);
                        
                         //**************Call snipPopup*************************
                         /*Snip popup does NOT work in its current form because
                         /*Swing has trouble copying generic forms for use in other
                         /*packages.  When JavaFx has come far enough along, meaning,
                         /*can properly handle drag and drop into matissa, this method
                         /*can be changed to use seperate FXML files instead of Swing.
                         /*Currently it is recommended to use the included Popup template
                         /*to create the generic popup handler for this Class we are
                         /*generating for.
                          */
                         
                         //snipPopup(classNAME, packageSlash, packageDot, selectedDIR);
                         //*****************************************************
                    }
                    
                
        
        
        
    
        
    /**
     * SnipXML Generates the palette items XML file that contains a reference
     * to the icon, display name, and tooltip locations.
     * 
     * @param packageFront
     *        This is the package name using front slash notation.
     * @param className
     *        This is the Class Name of the Item we are generating source for.
     * @param icon16
     *        This 16x16 .png file can not have the same name as the 32x32 .png
     * @param icon32
     *        This 32x32 .png file can not have the same name as the 16x16 .png
     * @param selectedDIR
     *        This is the directory to output the sources to.
     * @param packageDot
     *        This is the package name using dot notation.
     * @throws FileNotFoundException
     * @throws IOException
     * @throws URISyntaxException 
     */
    private void snipXML(
                            String packageFront, String className, 
                            String icon16,       String icon32,
                            String selectedDIR,  String packageDot
            
                        ) throws FileNotFoundException, IOException, URISyntaxException {
        Pc.codeTextArea.appendText("\n"+"Generating Source Files for Attributes: " + packageFront + " " + className   + " " + icon16 
                                        + " " + icon32 + " " + selectedDIR + " " + packageDot + "\n");
        
        //Read SnipXML template into a file.
        Pc.statusText.setText("Generating");
        Pc.codeTextArea.appendText("Reading XML Template\n");
        InputStream in = getClass().getResourceAsStream(this.getSnipXMLFile());
        Scanner scanner = new Scanner(in);
        
        
                    StringBuilder sb = new StringBuilder();
                    
                    while (scanner.hasNext()){
                            sb.append(scanner.nextLine());
                            sb.append("\n");
                            }
                    
        String cccTemplateString = sb.toString();
        
        Pc.codeTextArea.appendText("***********Generating\n");
        Pc.codeTextArea.appendText("Scanning File and Replacing Tokens\n");
        String replaceAll = cccTemplateString.replaceAll(this.getToken_Class_Name(), className)
                                             .replaceAll(this.getToken_Icon_16()   , icon16)
                                             .replaceAll(this.getToken_Icon_32()   , icon32)
                                             .replaceAll(this.getToken_PN_Slash()  , packageFront)
                                             .replaceFirst(this.getToken_PN_Dot()  , packageDot);
        
        
        
        Pc.codeTextArea.appendText("***********Finished\n");
        
        try {
            if (Auto){
            try (FileOutputStream saveFile = new FileOutputStream(selectedDIR + "\\src\\" + frontToBack + "\\" + className + ".xml")) {
                Pc.codeTextArea.appendText("\nSaving Generated Xml as: \n" + selectedDIR + "\\src\\" + frontToBack + "\\" + className + ".xml");
                saveFile.write(replaceAll.getBytes());
                saveFile.close();
                Pc.statusText.setText("Status: Done");
            }    
                
                
                
            }else{
                
            try (FileOutputStream saveFile = new FileOutputStream(selectedDIR + "\\" + className + ".xml")) {
                Pc.codeTextArea.appendText("\nSaving Generated Xml as: \n" + selectedDIR + "\\" + className + ".xml");
                saveFile.write(replaceAll.getBytes());
                saveFile.close();
                Pc.statusText.setText("Status: Done");
            }
            }
            
            
            } catch (Exception e) {
                Pc.statusText.setText("File Error: " + e.toString());  
            }
    
    
}
    
/**
 * This method generates the Main Java Class used for this palette item.
 * 
 * @param className
 *        className needs to be a valid Java class name.
 * @param selectedDIR
 *        This is where the generated source will be saved.
 * @param packageDot
 *        This is the palette package we are working with in dot form, foo.bar.class
 * @param utilName
 *        This is the palette utilities class, such as JavaSourceFilePaletteUtilities.
 * @throws FileNotFoundException
 * @throws IOException 
 */
    private void snipClass(String className, String selectedDIR, String packageDot, String utilName) throws FileNotFoundException, IOException {
        Pc.codeTextArea.appendText("\n"+"Generating Java Source File\n");
        
        //Read SnipXML template into a file.
        Pc.statusText.setText("Generating");
        Pc.codeTextArea.appendText("Reading Java Class Template\n");
        InputStream in = getClass().getResourceAsStream(this.getSnipClassFile());
        Scanner scanner = new Scanner(in);
        
        
                    StringBuilder sb = new StringBuilder();
                    
                    while (scanner.hasNext()){
                            sb.append(scanner.nextLine());
                            sb.append("\n");
                            }
                    
        String cccTemplateString = sb.toString();
        
        
        Pc.codeTextArea.appendText("Scanning File and Replacing Tokens\n");
        Pc.codeTextArea.appendText("***********Generating\n");
        String replaceAll = cccTemplateString.replaceAll(this.getToken_Class_Name(), className)
                                             .replaceAll(this.getToken_PN_Dot()  , packageDot)
                                             .replaceAll(this.Token_Palette_Util  , utilName);
                
        
        
        Pc.codeTextArea.appendText("***********Finished\n");
        
        try {
            if (Auto){
            try (FileOutputStream saveFile = new FileOutputStream(selectedDIR + "\\src\\" + frontToBack + "\\items\\" + className + ".java")) {
                Pc.codeTextArea.appendText("\nSaving Generated Java class as: \n" + selectedDIR + "\\src\\" + frontToBack + "\\items\\" + className + ".java");
                saveFile.write(replaceAll.getBytes());
                saveFile.close();
                Pc.statusText.setText("Status: Done");
            }    
                
                
                
            }else{
            
            try (FileOutputStream saveFile = new FileOutputStream(selectedDIR + "\\" + className + ".java")) {
                Pc.codeTextArea.appendText("\nSaving Generated Java class as: \n" + selectedDIR + "\\" + className + ".java");
                saveFile.write(replaceAll.getBytes());
                saveFile.close();
                Pc.statusText.setText("Status: Done");
            }
            }
        } catch (Exception e) {
          Pc.statusText.setText("File Error: " + e.toString());  
        }
}
/**
 * Snip Popup generator does NOT work in its current form because
 * Swing has trouble copying generic forms for use in other
 * packages.  When JavaFx has come far enough along, meaning,
 * can properly handle drag and drop into matissa, this method
 * can be changed to use seperate FXML files instead of Swing.
 * Currently it is recommended to use the included Popup template
 * to create the generic popup handler for this Class we are
 * generating for.
 * This method handles generating both the Popup Form Class and the Form itself.
 * 
 * 
 * @param className
 * @param packageSlash
 * @param packageDot
 * @param selectedDIR
 * @throws FileNotFoundException
 * @throws IOException 
 */
    private void snipPopup(String className, String packageSlash, String packageDot, String selectedDIR)throws FileNotFoundException, IOException {
        Pc.codeTextArea.appendText("\n"+"Generating Java Source and Form Files\n");
        
        //Read SnipXML template into a file.
        Pc.statusText.setText("Generating");
        Pc.codeTextArea.appendText("Reading Java Popup Class and Form Templates\n");
        
        ////////////////Popup Class Scanner
        InputStream in = getClass().getResourceAsStream(this.getSnipPopupClassFile());
        Scanner scanner = new Scanner(in);
        
        
                    StringBuilder sb = new StringBuilder();
                    
                    while (scanner.hasNext()){
                            sb.append(scanner.nextLine());
                            sb.append("\n");
                            }
                    
        String cccTemplateString = sb.toString();
        
        Pc.codeTextArea.appendText("Scanning File and Replacing Tokens\n");
        String replaceAll = cccTemplateString.replaceAll(this.getToken_Class_Name(), className)
                                             .replaceAll(this.getToken_PN_Dot()    , packageDot)
                                             .replaceAll(this.getToken_PN_Slash()  , packageSlash);
                
        Pc.codeTextArea.appendText("***********Generating\n");
        
        Pc.codeTextArea.appendText("***********Finished\n");
        
        try {
            try (FileOutputStream saveFile = new FileOutputStream(selectedDIR + "\\" + className + "Popup.java")) {
                Pc.codeTextArea.appendText("\nSaving Generated Java class as: \n" + selectedDIR + "\\" + className + "Popup.java");
                saveFile.write(replaceAll.getBytes());
                saveFile.close();
                Pc.statusText.setText("Status: Done");
            }
        
        } catch (Exception e) {
          Pc.statusText.setText("File Error: " + e.toString());  
        }
        ////////////Popup Class Scanner End
        
        ////////////////Popup Form Scanner
        InputStream inForm = getClass().getResourceAsStream(this.getSnipPopupFormFile());
        Scanner scannerForm = new Scanner(inForm);
        
        
                    StringBuilder sbF = new StringBuilder();
                    
                    while (scannerForm.hasNext()){
                            sbF.append(scannerForm.nextLine());
                            sbF.append("\n");
                            }
                    
        String FormTemplateString = sbF.toString();
        
        Pc.codeTextArea.appendText("Scanning File and Replacing Tokens\n");
        String replaceAllForm = FormTemplateString.replaceAll(this.getToken_Class_Name(), className)
                                                  .replaceAll(this.getToken_PN_Dot()  , packageDot)
                                                  .replaceAll(this.getToken_PN_Slash()  , packageDot);
                
        Pc.codeTextArea.appendText("***********Generating\n");
        Pc.codeTextArea.appendText(replaceAllForm);
        Pc.codeTextArea.appendText("***********Finished\n");
        
        try {
            try (FileOutputStream saveFile = new FileOutputStream(selectedDIR + "\\" + className + "Popup.form")) {
                Pc.codeTextArea.appendText("\nSaving Generated Form as: \n" + selectedDIR + "\\" + className + ".form");
                saveFile.write(replaceAllForm.getBytes());
                saveFile.close();
                Pc.statusText.setText("Status: Done");
            }
        
        } catch (Exception e) {
          Pc.statusText.setText("File Error: " + e.toString());  
        }
        ////////////Popup Form Scanner End
}

    /**
     * snipBundle generates bot the bundle.properties XML entry and well as
     * layer.xml entry. These need to be manually copied into the Netbeans Package.
     * 
     * @param className
     * @param displayName
     * @param toolTip
     * @param selectedDIR
     * @throws FileNotFoundException
     * @throws IOException 
     */
    private void snipBundle(String className, String displayName, String toolTip, String selectedDIR)throws FileNotFoundException, IOException, ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException {
    Pc.codeTextArea.appendText("\n"+"Generating XML Entries for Bundle and Layer Files\n");
        
        //Read BundleXML template into a file.
        Pc.statusText.setText("Generating");
        Pc.codeTextArea.appendText("Reading Bundle Template\n");
        
        ////////////////Bundle Layer Template Scanner
        InputStream in = getClass().getResourceAsStream(this.SnipBundleFile);
        Scanner scanner = new Scanner(in);
        
        
                    StringBuilder sb = new StringBuilder();
                    
                    //Begin with a newline.
                    sb.append("\n");
                    while (scanner.hasNext()){
                            sb.append(scanner.nextLine());
                            sb.append("\n");
                            }
        
        
        String cccTemplateString = sb.toString();
        
        Pc.codeTextArea.appendText("Scanning File and Replacing Tokens\n");
        Pc.codeTextArea.appendText("***********Generating\n");
        String replaceAll = cccTemplateString.replaceAll(this.getToken_Class_Name()      , className)
                                             .replaceAll(this.getToken_Display_Name()    , displayName)
                                             .replaceAll(this.getToken_Tool_Tip()        , toolTip);
                
        
        
        Pc.codeTextArea.appendText("***********Finished\n");
        
        try {
            if (Auto){
            try (FileOutputStream saveFile = new FileOutputStream(selectedDIR + "\\src\\" + frontToBack + "items\\resources\\" + this.BundleFile, true)) {
                Pc.codeTextArea.appendText("\nAppending bundle.properties and saving as: \n" + selectedDIR + "\\src\\" + frontToBack + "items\\resources\\" + this.BundleFile);
                saveFile.write(replaceAll.getBytes());
                saveFile.close();
                Pc.statusText.setText("Status: Done");
            }    
                
                
                
            }else{
            try (FileOutputStream saveFile = new FileOutputStream(selectedDIR + "\\" + className + "BundleEntry.xml")) {
                Pc.codeTextArea.appendText("\nSaving Generated Bundle Entry as: \n" + selectedDIR + "\\" + className + "BundleEntry.xml");
                saveFile.write(replaceAll.getBytes());
                saveFile.close();
                Pc.statusText.setText("Status: Done");
            }
            }
        } catch (Exception e) {
          Pc.statusText.setText("File Error: " + e.toString());  
        }
        ////////////Bundle Scanner End
        
        ////////////Generate Layer Entry
        
        //Read the layer file into a string.
        if (Auto){
            System.out.println("Starting to scan layer.xml...");
        ////////////////Bundle Layer Template Scanner
        DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
        DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
        Document doc = docBuilder.parse (new File(selectedDIR + "\\src\\" + frontToBack + "\\" + this.LayerFile));
        
        //Get a palette Categories list from the layer file.
        NodeList folderList = doc.getElementsByTagName("folder");
            
            for (int index = 0; index < folderList.getLength(); index++){    
                System.out.println("Folder List: " + folderList.item(index).getAttributes().getNamedItem("name").getTextContent());
                
                String element = folderList.item(index).getAttributes().getNamedItem("name").getTextContent().toString();
                
                this.categories_Array.add(element.toString());
                
                }
        
        ArrayList<String> myArray = new ArrayList();
        
        for (Object o:categories_Array){
            String newStr = o.toString();
            myArray.add(newStr);
        }
        System.out.println("MyArray: "+ myArray.toString());
        
    //Prompt User for Selection:
    
    final Stage secondaryStage = new Stage(StageStyle.UTILITY);
    final ComboBox myCombo = new ComboBox();
    myCombo.setPromptText("Choose a Palette Category");
    myCombo.getItems().setAll(myArray);
    myCombo.setOnAction(new EventHandler() {
      
                
                @Override
                public void handle(Event t) {
                    //Set the selection for category.
                    setSelected_Category(myCombo.getSelectionModel().getSelectedItem().toString());
                    secondaryStage.close();
                }
    });
    
    StackPane secondaryLayout = new StackPane();
    secondaryLayout.getChildren().add(myCombo);
    secondaryLayout.setStyle("-fx-background-color: lightgrey; -fx-padding: 10;");
    secondaryStage.setScene(new Scene(secondaryLayout, 200, 100));
    secondaryStage.setTitle("Selection");
    
    // specify stage locations. 
    secondaryStage.setX(400); secondaryStage.setY(200);
    
    secondaryStage.showAndWait();
            System.out.println("Selected: "+ this.getSelected_Category());
    int folderIndex = myArray.indexOf(getSelected_Category().toString());
            System.out.println("Folder Category Index: " + folderIndex);    
        //Add the new item to the document.
        
        //Create token to search for...        
        Attr a = doc.createAttribute("name");
        a.setValue(className + ".xml");               
        Attr url = doc.createAttribute("url");
        url.setNodeValue(className + ".xml");
        Element element = doc.createElement("file");
        element.setAttributeNode(a);
        element.setAttributeNode(url);
        
        //Add the new element node.
        folderList.item(folderIndex).appendChild(element);
        
        
        //Get ready to export the new layer.xml
        Transformer transformer = TransformerFactory.newInstance().newTransformer();
        transformer.setOutputProperty(OutputKeys.INDENT, "yes");
        transformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, "-//NetBeans//DTD Filesystem 1.2//EN");
        transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, "http://www.netbeans.org/dtds/filesystem-1_2.dtd");
        StreamResult result = new StreamResult(new StringWriter());
        DOMSource source = new DOMSource(doc);
        transformer.transform(source, result);

        String xmlOutput = result.getWriter().toString();
        
        System.out.println(xmlOutput);
        
        //Try to export.
        try (FileOutputStream saveFile = new FileOutputStream(selectedDIR + "\\src\\" + frontToBack + "\\" + this.LayerFile)) {
                Pc.codeTextArea.appendText("\nAdding entry to layer file: \n" + selectedDIR + "\\src\\" + frontToBack + this.LayerFile);
                saveFile.write(xmlOutput.getBytes());
                saveFile.close();
                Pc.statusText.setText("Status: Done");
            }  
        
        
        //If NOT auto just save...
        }else{
            try (FileOutputStream saveFile = new FileOutputStream(selectedDIR + "\\" + className + "LayerEntry.txt")) {
                Pc.codeTextArea.appendText("\nSaving Generated Layer Entry as: \n" + selectedDIR + "\\" + className + "LayerEntry.txt");
                String bundleEntry = "<file name=\""+className +".xml\"" + " url=\"" + className + ".xml\" "+"/>";
                saveFile.write(bundleEntry.getBytes());
                saveFile.close();
                Pc.statusText.setText("Status: Done");
            } catch (Exception e) {
          Pc.statusText.setText("File Error: " + e.toString());  
        }
        
        
        
         
        
    }
    }

    /**
     * @return the SnipXMLFile
     */
    public String getSnipXMLFile() {
        return SnipXMLFile;
    }

    /**
     * @param SnipXMLFile the SnipXMLFile to set
     */
    public void setSnipXMLFile(String SnipXMLFile) {
        this.SnipXMLFile = SnipXMLFile;
    }

    /**
     * @return the SnipPopupClassFile
     */
    public String getSnipPopupClassFile() {
        return SnipPopupClassFile;
    }

    /**
     * @param SnipPopupClassFile the SnipPopupClassFile to set
     */
    public void setSnipPopupClassFile(String SnipPopupClassFile) {
        this.SnipPopupClassFile = SnipPopupClassFile;
    }

    /**
     * @return the SnipPopupFormFile
     */
    public String getSnipPopupFormFile() {
        return SnipPopupFormFile;
    }

    /**
     * @param SnipPopupFormFile the SnipPopupFormFile to set
     */
    public void setSnipPopupFormFile(String SnipPopupFormFile) {
        this.SnipPopupFormFile = SnipPopupFormFile;
    }

    /**
     * @return the SnipBundleFile
     */
    public String getSnipBundleFile() {
        return SnipBundleFile;
    }

    /**
     * @param SnipBundleFile the SnipBundleFile to set
     */
    public void setSnipBundleFile(String SnipBundleFile) {
        this.SnipBundleFile = SnipBundleFile;
    }

    /**
     * @return the SnipClassFile
     */
    public String getSnipClassFile() {
        return SnipClassFile;
    }

    /**
     * @param SnipClassFile the SnipClassFile to set
     */
    public void setSnipClassFile(String SnipClassFile) {
        this.SnipClassFile = SnipClassFile;
    }

    /**
     * @return the Token_PN_Slash
     */
    public String getToken_PN_Slash() {
        return Token_PN_Slash;
    }

    /**
     * @param Token_PN_Slash the Token_PN_Slash to set
     */
    public void setToken_PN_Slash(String Token_PN_Slash) {
        this.Token_PN_Slash = Token_PN_Slash;
    }

    /**
     * @return the Token_PN_Dot
     */
    public String getToken_PN_Dot() {
        return Token_PN_Dot;
    }

    /**
     * @param Token_PN_Dot the Token_PN_Dot to set
     */
    public void setToken_PN_Dot(String Token_PN_Dot) {
        this.Token_PN_Dot = Token_PN_Dot;
    }

    /**
     * @return the Token_Class_Name
     */
    public String getToken_Class_Name() {
        return Token_Class_Name;
    }

    /**
     * @param Token_Class_Name the Token_Class_Name to set
     */
    public void setToken_Class_Name(String Token_Class_Name) {
        this.Token_Class_Name = Token_Class_Name;
    }

    /**
     * @return the Token_Display_Name
     */
    public String getToken_Display_Name() {
        return Token_Display_Name;
    }

    /**
     * @param Token_Display_Name the Token_Display_Name to set
     */
    public void setToken_Display_Name(String Token_Display_Name) {
        this.Token_Display_Name = Token_Display_Name;
    }

    /**
     * @return the Token_Icon_16
     */
    public String getToken_Icon_16() {
        return Token_Icon_16;
    }

    /**
     * @param Token_Icon_16 the Token_Icon_16 to set
     */
    public void setToken_Icon_16(String Token_Icon_16) {
        this.Token_Icon_16 = Token_Icon_16;
    }

    /**
     * @return the Token_Icon_32
     */
    public String getToken_Icon_32() {
        return Token_Icon_32;
    }

    /**
     * @param Token_Icon_32 the Token_Icon_32 to set
     */
    public void setToken_Icon_32(String Token_Icon_32) {
        this.Token_Icon_32 = Token_Icon_32;
    }

    /**
     * @return the Token_Palette_Util
     */
    public String getToken_Palette_Util() {
        return Token_Palette_Util;
    }

    /**
     * @param Token_Palette_Util the Token_Palette_Util to set
     */
    public void setToken_Palette_Util(String Token_Palette_Util) {
        this.Token_Palette_Util = Token_Palette_Util;
    }

    /**
     * @return the Token_Tool_Tip
     */
    public String getToken_Tool_Tip() {
        return Token_Tool_Tip;
    }

    /**
     * @param Token_Tool_Tip the Token_Tool_Tip to set
     */
    public void setToken_Tool_Tip(String Token_Tool_Tip) {
        this.Token_Tool_Tip = Token_Tool_Tip;
    }

    private EventHandler<ActionEvent> myActionHandler() {
        
       return null; 
    }

    /**
     * @return the selected_Category
     */
    public String getSelected_Category() {
        return selected_Category;
    }

    /**
     * @param selected_Category the selected_Category to set
     */
    public void setSelected_Category(String selected_Category) {
        this.selected_Category = selected_Category;
    }
}
